package com.org.Bibliotech;

import org.junit.Test;

import static org.junit.Assert.*;

public class MovieTest {



    @Test
    public void testCreateAndEquals(){
        Movie schindlersList = new Movie("Schindler's List", 1993, "Steven Spielberg", 10);
        Movie amadeus = new Movie ("Amadeus", 1984, "Milos Forman", 10);

        assertFalse(schindlersList.equals(amadeus));
        assertTrue(schindlersList.equals(new Movie("Schindler's List", 1993, "Steven Spielberg", 10)));
    }

    @Test
    public void testGets(){
        Movie amadeus = new Movie ("Amadeus", 1984, "Milos Forman", 10);

        assertEquals("Amadeus", amadeus.getTitle());
        assertEquals(1984, amadeus.getReleaseYear());
        assertEquals("Milos Forman", amadeus.getDirector());
        assertEquals(10, amadeus.getRating());
    }

    @Test
    public void testGetDetails(){
        Movie amadeus = new Movie ("Amadeus", 1984, "Milos Forman", 10);

        String expected = "Title: Amadeus\n"+
                           "Release Year: 1984\n" +
                            "Director: Milos Forman\n" +
                                "Rating: 10";



        String actual = amadeus.getDetails();
        assertEquals(expected, actual);
    }
}